<%--
 *  File:    CheckStatus.jsp
 *  @Author: Jamesli
 *  Date:    2010/07/22

 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  	Category cat = Category.getInstance("jsp.CheckStatus");
	String privilegeCode = "E0211,E0212";
  	String strModuleName = "CM";
  	String contextPath = request.getContextPath();
%>

<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>CheckStatus</title>
<PageFlow:CheckPageFlow pageName="p_checkstatus"/>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js">
</script>
</head>
<body>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
  <tr> 
    <td> 
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">        
          <tr class="deepblue-left">
            <td width="40" class="title_center"><%= label.getLabelName("L_SortNO")%></td>
            <td width="80" class="title_center"><%= label.getLabelName("L_StatusCode")%></td>
            <td width="200" class="title_center"><%= label.getLabelName("L_Status")%></td>
            <td  width="260" class="title_center"><%= label.getLabelName("L_CheckContent")%></td>
            <td width="180" class="title_center"><%= label.getLabelName("L_ErrorMsg")%></td>
            <td width="60" class="title_center"><%= label.getLabelName("L_ErrorNum")%></td>
          </tr>
        <%
          String CheckResult = request.getParameter("checkstatus").trim();
          Vector details = (Vector) pageContext.getAttribute("checkstatusvector");
          if(details == null) details = new Vector();

          if(CheckResult == null)
          CheckResult = "";
          if (CheckResult.length()!=10)
          {
               response.sendRedirect("/" + ConstantProp.DEFAULT_WAR_NAME + "/Error.jsp?" + OvalTools.randomURL() + "");
                   return;
          }

          String strClassType = "";
          String checkCode = "";
		  int i = 0;
        %>
        <logic:iterate id="onerow" collection="<%= details %>">
          <%
            if(i%2 == 1)
            {
              strClassType = "td-listrom";
            }else{
              strClassType = "none";
            }
            HashMap  myrow=(HashMap)onerow;
            Integer intSeq = (Integer)myrow.get("sequence");
            if(intSeq != null){
            	int sequence=((Integer)myrow.get("sequence")).intValue();
            	checkCode = CheckResult.substring(sequence-1,sequence);
            	//pageContext.setAttribute("errorcode",checkCode);
            }else{
            	checkCode = "-1";
            	//pageContext.setAttribute("errorcode",checkCode);
            }
            i++;
          %>
            <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%= strClassType %>'"  class="<%= strClassType %>">
              <td width="40" class="td_center"><custom:write name="onerow" property="sequence" nbsp="true"/></td>
              <td width="80" class="td_center"><%=checkCode%>&nbsp;</td>
              <td width="200" class="td_center" ><custom:write property="errorlevel" name="onerow" dictType="ErrorLevel" nbsp="true" value="<%=checkCode%>"/>&nbsp;</td>
              <td width="200"><custom:write name="onerow" property="cleanrule" dictType="DataCleanRule" nbsp="true"/>&nbsp;</td>
              <td width="200"><custom:write name="onerow" property="errormessage" nbsp="true"/>&nbsp;</td>
              <td width="80"><custom:write name="onerow" property="errorqty" nbsp="true"/>&nbsp;</td>
        	</tr>
        </logic:iterate>
      </table>
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr> 
          <td class="summary_top"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td class="td_center"><a onclick="window.close()"><custom:button type="1" label="L_Close" imgsrc="close.gif" border="0" style="width:60"/></a></td>
  </tr>
</table>
</body>
</html>


